import Vue from 'vue'

const apiUrl = 'api/'

export default {
  queryOrgByPage (pageNo, pageSize = 10, customerId) {
    return Vue.http.get(apiUrl + 'organization/page/' + customerId, {params: {pageNo, pageSize}})
  },
  getOrgById (id) {
    return Vue.http.get(apiUrl + 'organization/' + id)
  },
  saveOrg (organization) {
    if (!organization.pkid) {
      return Vue.http.post(apiUrl + 'organization', organization)
    } else {
      return Vue.http.put(apiUrl + 'organization', organization)
    }
  }
}
